package com.zzz.four;

/*
 * @author zzr
 * @date: 2025/07/10  23:03
 * @description: 等讲解
 */
public class Demo2 {
    public boolean exist(String[] board, String word) {
        // 处理空情况
        if (board == null || board.length == 0 ||word == null || word.length() == 0) {
            return false;
        }

        // 将一维字符串转换为二维字符数组
        char[][] grid = new char[board.length][];
        for (int i = 0; i < board.length; i++) {
            grid[i] = board[i].toCharArray(); // 将每一行字符串转换成字符数组
        }
        int rows = grid.length; //行数
        int cols = grid[0].length; // 列数

        return true;
    }
}
